import { createSlice } from "@reduxjs/toolkit";

const userSlice = createSlice({
    name: 'user',
    initialState: {
        user: {
            name: '包包',
            province: '北京',
            sex: 'female',
            residence: ["上海"],
            notes: '这个人很懒，什么都没留下'
        },
    },
    reducers: {
        updateUser: (state,action)=>{
            return{
                ...state,
                user: action.payload
            }
        },
    }
})

export const  {updateUser} =userSlice.actions
export default userSlice.reducer;